package com.jiazhong.basic.shuxin.design.工厂模式;

import com.jiazhong.basic.shuxin.design.工厂模式.工厂方法模式.*;
import com.jiazhong.basic.shuxin.design.工厂模式.抽象工厂模式.AbstractFactory;
import com.jiazhong.basic.shuxin.design.工厂模式.抽象工厂模式.IFactory;
import com.jiazhong.basic.shuxin.design.工厂模式.抽象工厂模式.MetaFactory;
import com.jiazhong.basic.shuxin.design.工厂模式.简单工厂模式.PhoneFactory;

public class App {

    private static void a(){
        Phone phone = PhoneFactory.makePhone("魅族");
        if (phone != null) {
            phone.show();
        }
    }

    private static void b(){
        AbstractPhoneFactory phoneFactory = new VivoPhoneFactory();
        Phone p1 = phoneFactory.makePhone();
        p1.show();
    }

    private static void c(){
        AbstractFactory factory = new MetaFactory();
        PC pc = factory.getPC();
        Phone phone = factory.getPhone();
        phone.show();
        pc.showPC();
    }
    public static void main(String[] args) {
        c();
    }
}
